package com.forcedotcom.model
{
	import com.forcedotcom.AccountConnection;
	import com.forcedotcom.components.CommentItem;
	import com.salesforce.objects.SObject;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;

	[Bindable]
	public class CommentItemData
	{
			public var comment:SObject;
			public var connection:AccountConnection;
			public var commentItem:CommentItem;
			public var _profilePic:Bitmap;
			private var bmData:BitmapData;
			
			public function set profilePic(img:Bitmap):void {
				trace("ProfilePic is being set on the post item data...");
				_profilePic = img;
				bmData = _profilePic.bitmapData;
				if (img != null) {
					commentItem.profilePic = img;
				}
			}
			public function get profilePic():Bitmap {
				if (bmData != null) {
					return new Bitmap(bmData);
				} else {
					return null;
				}
			}
			
			public function CommentItemData(comment:SObject, connection:AccountConnection)
			{
				this.comment = comment;
				this.connection = connection;
			}
	}
}